//https://github.com/babel/babel-loader
//http://webpack.github.io/docs/


// var CommonsChunkPlugin = require("webpack/lib/optimize/CommonsChunkPlugin");

var path = require('path');
var webpack = require('webpack');

var NODE_ENV = process.env.NODE_ENV;
var ROOT_PATH = path.resolve(__dirname,"..");
var SRC_DIR = 'src';

var config = {
    paths: {
        src: path.join(ROOT_PATH, SRC_DIR),
        out: path.join(ROOT_PATH, "build"),
        app: path.join(ROOT_PATH, "app.js"),
    }
}


module.exports = {
    entry: {
        app: ["react", "zero", "heaven"]
    },

    output: {
        path: config.paths.out,
        filename: '[name].js',
    },
    module: {
        loaders: [
            {
                test: /\.js$/,
                // exclude: /(node_modules|bower_components)/,
                loader: ["babel-loader"]
            },
            {
                test: /\.css$/,
                use: [
                    'style-loader',
                    'css-loader'
                ]
            },
            {
                test: /\.scss$/,
                loader: [
                    'style-loader',
                    'css-loader',
                    'sass-loader'
                ]
            },
            {
                test: /\.(woff|svg|eot|ttf)\??.*$/,

                loader:
                    'url-loader',

            }
        ]
    },
    plugins: []
}
